package com.ity.teamanagement.code;

import lombok.Getter;

/**
 * @author coderFu
 * @create 2021/5/23
 */
@Getter
public enum UserCode implements Code{


    USER_AUTH_ERROR(false,1000,"用户权限不足"),
    USER_PASSWORD_ERROR(false,1001,"用户密码错误"),
    USER_LOGIN_SUCCESS(true,1002,"用户登录成功"),
    USER_NOT_EXIST(false,1003,"用户不存在"),
    USER_NOT_LOGIN(false,1004,"用户未登录"),
    USER_NAME_IS_EXIST(false,1005,"用户名已存在"),
    USER_CREATE_SUCCESS(true,1006,"用户创建成功"),
    USER_UPDATE_SUCCESS(true,1007,"用户修改成功"),
    USER_UPDATE_ERROR(false,1008,"用户修改失败"),
    USER_DELETE_SUCCESS(true,1009,"用户删除成功"),
    USER_DELETE_ERROR(false,1010,"用户删除失败");



    private boolean success;

    private Integer code;

    private String message;

    UserCode(boolean success, Integer code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
